<?php !defined('DYHB_PATH') && exit; /* DoYouHaoBaby Framework 模板缓存文件 生成时间：2011-05-30 20:34:48  */ ?>
<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_header.html" ,"" ,"" ,"" )  ;?>

<script type="text/javascript">
var TEMP_PUBLIC = '__TMPLPUB__';

var apps = new Array();
var run = 0;
function testlink() {

	if(apps[run]) {

		Dyhb.Dom.$('status_' + apps[run]).innerHTML = D.L( '正在连接...' );
		Dyhb.Dom.$('link_' + apps[run]).src = Dyhb.Dom.GetAttr('link_'+apps[run],'testlink') + '?sid=<?php echo( $sid ); ?>';	
	}
	run++;
}

Dyhb.Dom.Ready(function(){
   testlink();
 });

</script>


   <!-- 标题  -->
   <div class="title"><?php print G::L( "应用列表", null, null ) ; ?></div>

   <div class="note">
	<p class="i"><?php print G::L( "如果出现\"通信失败\"，请点击\"编辑\"尝试设置应用域名对应的 IP。", null, null ) ; ?></p>
   </div>

   <!-- 工具条  -->
   <div class="toolbar">
      <!--  功能操作区域  -->
      <div class="operate left" >
	      <input type="button" name="add" value="<?php print G::L( "新增", null, null ) ; ?>" onclick="add()" class="add button">
          <input type="button" name="edit" value="<?php print G::L( "编辑", null, null ) ; ?>" onclick="edit()" class="edit button">
          <input type="button" name="delete" value="<?php print G::L( "删除", null, null ) ; ?>" onclick="foreverdel()" class="delete button">
      </div>
      <!-- 查询区域 -->
      <div class="right search_form">
         <form method='post' action="__ACTION__">
            <div class="left">
			   <input type="text" name="application_name" title="<?php print G::L( "应用名", null, null ) ; ?>" class="field" >
               <input type="submit" id="" name="search" value="<?php print G::L( "查询", null, null ) ; ?>" onclick="" class="search button">
			</div>
        </form>
     </div>
  </div>

  <!-- 清除浮动 -->
  <span class="clear"></span>

  <!-- 正文 -->
  <div id="content" class="content">

      <table class="data full" id="checkList">
        <thead>
         <tr>
          <th width="5px"><input type="checkbox" onclick="checkAll('checkList')"></th>
          <th><a href="javascript:sortBy('application_id','<?php echo( $sSortByUrl ); ?>')" title="<?php print G::L( "按照编号", null, null ) ; ?><?php echo( $sSortByDescription ); ?><?php print G::L( "排列", null, null ) ; ?> "><?php print G::L( "编号", null, null ) ; ?></a></th>
          <th><a href="javascript:sortBy('application_name','<?php echo( $sSortByUrl ); ?>')" title="<?php print G::L( "按照应用名称", null, null ) ; ?><?php echo( $sSortByDescription ); ?><?php print G::L( "排列", null, null ) ; ?> "><?php print G::L( "应用名称", null, null ) ; ?></a></th>
          <th><a href="javascript:sortBy('application_url','<?php echo( $sSortByUrl ); ?>')" title="<?php print G::L( "按照应用的", null, null ) ; ?> URL<?php echo( $sSortByDescription ); ?><?php print G::L( "排列", null, null ) ; ?> "><?php print G::L( "应用的 URL", null, null ) ; ?></a></th>
          <th><?php print G::L( "通信情况", null, null ) ; ?></th>
          <th><?php print G::L( "操作", null, null ) ; ?></th>
          </tr>
          </thead>
          <tbody>
          <?php $i=1 ;?>
<?php if( is_array( $arrList ) ) : foreach( $arrList as $key=>$value): ?>

		  <tr>
			<td><input type="checkbox" name="key" value="<?php echo( $value['application_id'] ); ?>" class="field" /></td>
			<td><?php echo( $value['application_id'] ); ?></td>
			<td><a href="javascript:edit('<?php echo( $value['application_id'] ); ?>')"><?php echo( $value['application_name'] ); ?></a></td>
            <td><a href="<?php echo( $value['application_url'] ); ?>"><?php echo( $value['application_url'] ); ?></a></td>
		    <td><div id="status_<?php echo( $value['application_id'] ); ?>"></div>
			<script id="link_<?php echo( $value['application_id'] ); ?>" testlink="<?php echo( G::U( 'application/ping',array(
			
			   'url'=>str_replace( '/','@',E::authcode( urlencode( $value['application_url'] ),'ENCODE' ) ),
			   'ip' =>$value['application_ip'].'*',
			   'id' =>$value['application_id'],
			   'random' =>rand(),
			)) );?>"></script> 
			<script type="text/javascript">apps[<?php echo( $key ); ?>] = '<?php echo( $value['application_id'] ); ?>';</script>
			</td>
			<td><?php if( $value['application_status']==1 ) :?><a href="javascript:forbid('<?php echo( $value['application_id'] ); ?>')"><?php print G::L( "禁用", null, null ) ; ?></a><?php else: ?><a href="javascript:resume('<?php echo( $value['application_id'] ); ?>')"><?php print G::L( "恢复", null, null ) ; ?></a><?php endif; ?>&nbsp;<a href="javascript:edit('<?php echo( $value['application_id'] ); ?>')"><?php print G::L( "编辑", null, null ) ; ?></a>&nbsp;</td>
		  </tr>
          
<?php $i++ ;?>
<?php endforeach;endif; ?>
        </tbody>
        </table>

		<!-- 工具条  -->
		<div class="toolbar">
		   <!--  功能操作区域  -->
           <div class="operate" >
              <input type="button" name="add" value="<?php print G::L( "新增", null, null ) ; ?>" onclick="add()" class="add button">
              <input type="button" name="edit" value="<?php print G::L( "编辑", null, null ) ; ?>" onclick="edit()" class="edit button">
              <input type="button" name="delete" value="<?php print G::L( "删除", null, null ) ; ?>" onclick="foreverdel()" class="delete button">
           </div>
	    </div>

		<!-- 分页条  -->
		<?php echo( $sPageNavbar ); ?>

   </div>
   <!-- end content -->

<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_footer.html" ,"" ,"" ,"" )  ;?>